<%@ page import="com.jkt.rms.commons.includes.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.jkt.rms.business.*"%>
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="/spring"%>


<html>
<head>
<title><fmt:message key="lbl.title.resourceRole" /></title>
</head>
<body>
<center>
<h2 id="headerbar"><fmt:message key="lbl.title.resourceRole" /></h2>
<div id="content">
<table width="90%" cellpadding="0" cellspacing="0">
	<c:if test="${ not empty errors.allErrors}">
		<tr valign="top" align="left">
			<td width="80%">
			<div id="errorFieldSet">
			<fieldset><legend><strong>Errors</strong></legend>
			<table width="80%" border="1" cellpadding="0" cellspacing="0">
				<c:forEach var="err" items="${errors.allErrors}">
					<spring:message code="${err.code}" arguments="${err.arguments}" />
					<br/>
				</c:forEach>
				<tr>
				</tr>
			</table>
			</fieldset>
			</div>
			</td>
		</tr>
	</c:if>
	<c:if test="${ not empty resourceRole.message}">
		<tr valign="top" align="left">
			<td width="80%">
			<div id="infoFieldSet">
			<fieldset><legend><strong>Messages</strong></legend>
			<table width="80%" border="1" cellpadding="0" cellspacing="0">
				<spring:message code="${resourceRole.message}" />
			</table>
			</fieldset>
			</div>
			</td>
		</tr>
	</c:if>

	<tr valign="top" align="center">
		<td width="80%">
		<fieldset><legend><strong>Search Role</strong></legend> <form:form
			method="POST" commandName="resourceRole" name="resourceRole" action="resourcerole.htm?method=searchRoles">
			<table width="80%" cellpadding="0" cellspacing="0">
				<tr>
					<td align='right'><label for="textRoleCode">Role Code:</label></td>
					<td align='center'><form:input path="searchRoleCode"
						maxlength="100" tabindex="1" /></td>
					<td align='right' class=header><label for="textRoleName">Role
					Name:</label></td>
					<td align='center' class=value><form:input
						path="searchRoleName" maxlength="8" tabindex="2" /></td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td ><input type="submit"
						name='searchButton' value="Search" /></td>
					<td><input type="button" name='findAllButton' value="Find All"
						onclick="dosubmit('resourceRole','resourcerole.htm?method=findAllRoles')" /></td>
				</tr>
			</table></fieldset>
		</td>
		<c:if test="${not empty searchResult}">
		<form:hidden path="searchMethod" />
			<tr valign="top" align="center">
				<td width="80%">
				<div id="vendorSearch">
				<fieldset><legend><strong>Roles Details</strong></legend>
				<table width="80%" cellpadding="0" cellspacing="0" border="1">
					<tr bgcolor="#AAAAAA">
						<td>Role Code</td>
						<td>Role Name</td>
						<td>Status</td>
						<td>Edit</td>
					</tr>
					<c:forEach var="vo" items="${searchResult}">
						<tr>
							<td>${vo.roleCode}</td>
							<td>${vo.roleName}</td>
							<td>${vo.showStatus}</td>
							<td><a
								href='resourcerole.htm?method=loadEditResourceRole&roleName=${vo.roleName}&searchRoleName=<c:out value="${resourceRole.searchRoleName}"/>&searchRoleCode=<c:out value="${resourceRole.searchRoleCode}"/>&searchMethod=<c:out value="${resourceRole.searchMethod}"/>' >
							Edit </a></td>
						</tr>
					</c:forEach>
				</table>
				</fieldset>
				</div>
		</c:if>
		</form:form>
	</tr>
	<tr valign="top" align="center">
		<td width="70%">
		<fieldset><legend><strong>Add Role</strong></legend> <form:form
			method="POST" commandName="resourceRole" name="addrole" action="resourcerole.htm?method=addRole">
			<table border="0" width="80%">
				<tr>
					<td align='right'><label for="textRoleCode">Role Code:<font
						color="red">*</font></label></td>
					<td align='center'><form:input path="roleCode" maxlength="8"
						tabindex="3" title="roleCode" /></td>
					<td align='right' class=header><label for="textRoleName">Role
					Name:<font color="red">*</font></label></td>
					<td align='center' class=value><form:input path="roleName"
						maxlength="200" tabindex="4" /></td>
				</tr>
				<tr>
					<td align='right'>Role Description:</td>
					<td align="center"><form:textarea path="roleDesc" rows="4"
						cols="20" title="Role Desc"  tabindex="4" /></td>
				</tr>
				<tr><td>&nbsp;</td></tr>
				<tr>
					<td>&nbsp;</td>
					<td align="right"><input class="value" type='submit' name='button'
						value='Add' title=""></td>
				</tr>
			</table></fieldset>
		</td>
	</tr>
</table>

</form:form></div>
<table><tr><td><%@ include file="footer.jsp"%></center></td></tr></table>
</body>
</html>
